#
# MAINTAINER        Carson,C.J.Zeong <zcy@nicescale.com>
# DOCKER-VERSION    1.6.2
#
# Dockerizing Mysql: Dockerfile for building Mysql images
#

FROM fanrong33/centos7:v1.0
MAINTAINER fanrong33

ENV DATA_DIR /data/mysql

# 安装mysql5.7
RUN rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 && \
    wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm && \
    yum -y install mysql57-community-release-el7-10.noarch.rpm && \
    yum -y install mysql-community-server

ADD my.cnf /etc/my.cnf

# groupadd mysql && \
# useradd -r -g mysql -s /bin/false mysql && \

RUN mkdir -p /data/mysql && \
    chown -R mysql:mysql /data/mysql/ && \
    chmod -R go-rwx /data/mysql/ && \
    chmod +t /data/mysql/
    

EXPOSE 3306

VOLUME ["/data/mysql"]

ADD supervisor_mysqld.conf /etc/supervisor.conf.d/mysqld.conf


# Install Mariadb
#RUN rpm --rebuilddb && \ 
#    yum install -y mariadb mariadb-server && \
#    yum clean all

#ADD mysqld_charset.cnf /etc/my.cnf.d/

#COPY scripts /scripts
#RUN chmod +x /scripts/start

#EXPOSE 3306

#VOLUME ["/var/lib/mysql"]

#ENTRYPOINT ["/scripts/start"]




